package com.luoy.pattern;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

/**
 * @desc:
 * @author: luoy
 * @date: 2022-11-01 09:50
 */
public class Compile {

    public static void main(String args[]) {
        String str = "DORIS_470_testDB_doris2";
//        String pattern = "doris[1-9]";
        String pattern = "^DORIS_470_testDB_doris2";
//        String pattern = "/Doris+/";

        Pattern r = Pattern.compile(pattern);
        Matcher m = r.matcher(str);
        System.out.println(m.matches());
    }
}
